﻿using System.Collections.Generic;
using NUnit.Framework;
using Vk.Methods.Common;
using Vk.Methods.Groups;
using Vk.Methods.Photos;
using Vk.Methods.Stats;

namespace UnitTests
{
    [TestFixture]
    class CommonTests
    {
        [Test]
        public void CamelCaseToSnakeCaseConverterTest()
        {
            Assert.AreEqual("closed", new ApiStringEnum<GroupAccess>(GroupAccess.Closed).ToString());
            var bigLetterSnake = new ApiStringEnum<AgeEnum>(AgeEnum.From12To18).ToString();
            Assert.AreEqual("From12_to18", bigLetterSnake);
            Assert.AreEqual("from12_to18", bigLetterSnake.WithFirstSmallLetter());
        }

        [Test]
        public void PrivacyTest()
        {
            var privacy = new Privacy(new List<object>()
            {
                -123,
                "-list1",
                new AccessPrivacyType(AccessPrivacyType.AccessPrivacyTypeEnum.All)
            });
            var str = privacy.ToString();
            Assert.AreEqual("-123,-list1,all", str);

            Assert.AreEqual(new[] { -1 }, privacy.ListIds);
            Assert.AreEqual(new[] { -123 }, privacy.UserIds);
            Assert.AreEqual(new [] { new AccessPrivacyType(AccessPrivacyType.AccessPrivacyTypeEnum.All) }, privacy.Types);
        }
    }
}
